* Load data
use "$data/main_touse.dta", replace

* Set lottery high CTB estimates to missing

replace patience_ctb_trim=. if ctb==4
replace patience_ctb_trim_high=. if ctb==4

/* Table A18 Sociodemographic Predictors of Binary Patience Measures: Weighted Data */
* Linear regression with binary DV and weights
svyset RespondiID [pweight=weights_full_sample]
svy: reg patience_ctb_trim
outreg2 using "$output/TableA18.xls", ctitle("EMPTY") excel bdec(3) sdec(3) stats(coef se) replace

foreach dv in $varlist  {
svy: reg `dv'_high ///
age3549 age5064 age65above ///
hs some_college ba_or_more ///
i.inc_group ///
female white 
outreg2 using "$output/TableA18.xls", ctitle("`dv'_high") excel bdec(3) sdec(3) stats(coef se) append

* Adding ideology
svy: reg `dv'_high ///
age3549 age5064 age65above ///
hs some_college ba_or_more ///
i.inc_group ///
female white ///
ideo_right ideo_middle 
outreg2 using "$output/TableA18.xls", ctitle("`dv'_high") excel bdec(3) sdec(3) stats(coef se) append

* Adding partisanship
svy: reg `dv'_high ///
age3549 age5064 age65above ///
hs some_college ba_or_more ///
i.inc_group ///
female white ///
republican independent 
outreg2 using "$output/TableA18.xls", ctitle("`dv'_high") excel bdec(3) sdec(3) stats(coef se) append
}
